<template>
  <div class="ArticleItem-container">
    <!--文章列表-->
    <!--<van-cell class="article-item" :to="'/article/' + article.art_id">-->
    <van-cell class="article-item" :to="{name: 'article', params: {articleId: article.art_id}}">
      <div slot="title" class="title">{{article.title}}</div>
      <div slot="label">
        <div v-if="article.cover.type === 3" class="cover-warp">
          <div v-for="(img, index) in article.cover.images" :key="index" class="cover-item">
            <van-image width="100" height="100" fit="cover" :src="img"></van-image>
          </div>
        </div>
        <div class="label-info">
          <span>{{article.aut_name}}</span>
          <span>{{article.comm_count}}评论</span>
          <span>{{article.pubdate | relativeTime }}</span>
        </div>
      </div>
      <van-image slot="default" v-if="article.cover.type === 1" width="100" height="100" fit="cover" :src="article.cover.images[0]"></van-image>
    </van-cell>
  </div>
</template>

<script>
export default {
  name: 'ArticleItem',
  components: {},
  data () {
    return {
    }
  },
  props: {
    article: {
      required: true,
      type: Object
    }
  },
  methods: {
  }
}
</script>

<style scoped lang="less">
.ArticleItem-container{
  /deep/ .article-item{
    .title{
      font-size: 16px;
      color: #3a3a3a;
    }
  }
  /deep/ .van-cell__value{
    width: 120px;
    height: 100px;
    flex: unset;
    .van-image{
      width: 120px !important;
      height: 100px !important;
    }
  }
  .label-info span{
    margin-right: 10px;
  }
  .cover-warp{
    display: flex;
    justify-content: space-between;
  }
}
</style>
